﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="maildustbin.aspx.cs" Inherits="Basic_maildustbin" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>邮件垃圾箱</title>
   <link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
   <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script> 
  <script type="text/javascript">
  function check(){
  var num=$("input:checked").length;
  if(num==0){
    alert("您未选择任何消息！");
    return false;}
  else
    return true;
  }
    function checkall(){
  var num=$("input:checked").length;
  if(num==0){
    alert("您未选择任何消息！");
    return false;}
  else
    return confirm("从垃圾箱删除后不可恢复，您确定要删除？");
  }
  </script> 
  <style type="text/css">
  h2{
  margin-top:-38px;
  padding-left:90px;
  color:#77ac98;
  }
  .mail_pack{
     padding-left:20px;
     padding-right:20px;
     padding-bottom:10px;
      padding-top:10px;
  }
  </style> 
</head>
<body>
    <form id="form2" runat="server">
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div class="mail_pack">
          <div><img src="../Images/Mail_Junk.png" alt="垃圾箱" /><h2>垃圾箱
          </h2></div> 
    </div>
   <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
               <div style="background: #FFFCC9;border: 1px solid #FFD667;">
                  <div style=" float:left; width:50%"><img id="warning"  src="../Images/Warning.png" alt="提示" />若您想看消息内容，请选择恢复此消息</div>
                  <div style=" text-align:right;"><asp:Button ID="Button1" runat="server" Text="彻底删除" OnClick="Button1_Click" OnClientClick="return checkall();" />
                      <asp:Button ID="Button2" runat="server" Text="全部恢复" OnClick="Button2_Click" OnClientClick="return check();" />
                      <asp:DropDownList ID="ddlFrom" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFrom_SelectedIndexChanged">
                          <asp:ListItem Value="1" Selected="True">收件箱</asp:ListItem>
                          <asp:ListItem Value="2">发件箱</asp:ListItem>
                      </asp:DropDownList>
                  </div></div> 
                <asp:GridView ID="GridView1" runat="server" CssClass="gvStyle" AlternatingRowStyle-CssClass="alt" 
                PagerStyle-CssClass="pgr" AutoGenerateColumns="False" 
                Width="100%" Font-Bold="False" EmptyDataText="暂时没有消息！" 
                EnableTheming="False" 
                DataKeyNames="id" OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField>
                              <HeaderTemplate>
                               <asp:CheckBox ID="CheckBox_All" runat="server" Text="" AutoPostBack="true" OnCheckedChanged="CheckAll" />
                             </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="ItemBox" runat="server" />
                            </ItemTemplate>
                            <HeaderStyle Width="25px" />
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="来自">
                            <ItemStyle Width="50px" />
                            <ItemTemplate>
                                <%#(bool)(Eval("instatus").ToString() == "1") ? "收件箱" : "发件箱"%>
                            </ItemTemplate> 
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="收/发件人">
                            <HeaderStyle Width="100px" />
                            <ItemTemplate>
                                <%#strName(Convert.ToString(Eval("instatus")), Convert.ToString(Eval("name1")), Convert.ToString(Eval("name2")))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="title" HeaderText="消息标题" />
                        <asp:TemplateField HeaderText="恢复">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="getback" ImageUrl='~/js/themes/icons/undo.png'
                                    ToolTip="恢复此消息" CommandArgument='<%# Eval("id") %>' />
                            </ItemTemplate>
                            <ItemStyle Width="35px" />
                        </asp:TemplateField>
                    </Columns>
                         <PagerStyle CssClass="pgr" />
                     <AlternatingRowStyle CssClass="alt" />
                </asp:GridView>
                <webdiyer:aspnetpager id="AspNetPager1" runat="server"
                        HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页" 
                        PageIndexBoxType="TextBox" PageSize="15" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        ShowPageIndexBox="Always" Width="100%" CustomInfoHTML="共<font color=blue><b>%RecordCount%</b></font>条消息 每页：<font color=blue><b>%PageSize%</b></font> 条 共<font color=blue><b>%PageCount%</b></font>页 当前页：<font color=red><b>%CurrentPageIndex%/%PageCount%</b></font>" OnPageChanged="AspNetPager1_PageChanged" CustomInfoSectionWidth="50%" FirstPageText="首页" AlwaysShow="True" CustomInfoTextAlign="Left">
                </webdiyer:aspnetpager>
            </ContentTemplate>
        </asp:UpdatePanel></div>  
    </form>
</body>
</html>
